$(function() {
    $("#login-captcha").bind("click", function () {
        $.ajax({
            type: 'post',
            url: "/admin/generateCaptcha",
            data: '',
            dataType: "json",
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            success: function (res) {
                $("#img-captcha").attr('src', res.captcha);
            }
        })
    })
});